<template>
    <div>
        <el-steps :active="action">
            <el-step title="请选择医生和时间段" description="填写您的预约信息"></el-step>
            <el-step title="请确认订单" description="确认"></el-step>
            <el-step title="预约成功 " description="请立即缴费"></el-step>
        </el-steps>

        <router-link :to="href" >
            <el-button type="primary" @click="dis" :disabled="but">选择医生</el-button>
        </router-link>
        <el-container>
            <el-main style="height: 1000px ">
                <router-view />
                <!-- <el-button type="primary" @click="next" :disabled="close" ref="nextstap">下一步</el-button> -->
            </el-main>
        </el-container>
    </div>
</template>
    <script>

export default {
    name: 'HelloWorld',
    data() {
        return {
            doctor: "",
            action: 1,
            href: "/PreDoctor",
            but: false
        }

    },
    methods: {
        // next() {
   
        //     if (this.$route.path == "/PreDoctor") {
        //         this.$router.push("/PreMoney");
        //         this.action = 2;
        //     } else if (this.$route.path == "/PreMoney") {
        //         this.$router.push("/PreSuccess");
        //         this.action = 3;
        //     }


        // },
        dis() {
            this.but = true
        }
        // nextstep(action){
        //     this.action=action
        // }

    },
    watch:{
        $route(to,from){
            if (from.path == "/PreDoctor") {
                console.log(to.path)
                this.action = 2;
            } else if (from.path == "/PreMoney") {
                console.log(to.path)
                this.action = 3;
            }

	}
    }
}
</script>
      <style>
      .el-main {
          color: #333;
          text-align: center;
          line-height: 160px;
      }
      </style>